﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyAnimalOOP
{
    public abstract class Animal
    {
        public Animal() {  }
        public Animal(Substance breathes) : this()
        {
            Breathes = breathes;
        }
        public Substance Breathes { get; set; }
        public virtual bool CarriesYoung { get; set; }
        public abstract void Breath();
        public void Breath(Substance substance)
        {
         //   Breathes = substance;
            if(substance != this.Breathes)
            {
                Console.WriteLine("Croak!");
            }
        }
    }

    public enum Substance{
        Water,
        Air
    }

    public abstract class Mammal : Animal
    {
        public Mammal() : base(Substance.Air) {
            CarriesYoung = true;
        }

        public string HairColor { get; set; }
        public abstract void Speak();

        public override void Breath()
        {
            Console.WriteLine("Mammals breath " + Breathes);
        }
    }
    public class Cat : Mammal
    {
        public override void Speak()
        {
            
        }

        public override void Breath()
        {
            Console.WriteLine("All cats breath " + Breathes);
            base.Breath();
        }
    }
    public class Dog : Mammal
    {


        public override void Speak()
        {
            Console.WriteLine("The dog says,'Bow wow wow, yippee yo yippee yay'");
        }

        public override void Breath()
        {
            Console.WriteLine("Dogs always breath " + this.Breathes);
        }
    }

    public abstract class Fish : Animal
    {
        public Fish() : this(SwimSpeed.Fast) { }
        public Fish(SwimSpeed speed) :
            base()
        {
                Speed = speed;
        }
        public SwimSpeed Speed { get; set; }
  

        public abstract void Swim();

        public override void Breath()
        {
            Console.WriteLine("Fish always breath water");

        }
    }

    public class Shark : Fish
    {
        public override void Swim()
        {
            Console.WriteLine("The shark swims " + this.Speed);
        }
    }

    public enum SwimSpeed
    {
        Fast,
        Slow
    }
    
}
